<!DOCTYPE html>
<html>
  <head>
    <title>悦淘新房</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	  <link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
	  <link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
	  <link rel="stylesheet" href="${s.base}/mobile/wechat/css/base.css">
	  <link rel="stylesheet" href="${s.base}/mobile/wechat/css/component.css">
  </head>
  <body>
  <div class="xyg-nav">
	  <div class="xyg-nav-content">
	  &nbsp;	<!--<span><svg class="icon" aria-hidden="true"><use xlink:href="#iconxiangzuo"></use></svg></span>-->
	  	我的客户
        <span class="xyg-nav-content-right"></span>
	  </div>
  </div>  
  <div class="xyg-index">
   <style type="text/css">
	  html,body{background:#f5f5f5;}
	  .xyg-nav{width:96%; height:6rem; background:#CC0000; padding:0px 2%;}
	  .xyg-nav .icon{fill:#ffffff;}
	  .xyg-nav .xyg-nav-content{width:100%; height: 2rem;line-height: 2rem; text-align: left; font-size:0.8rem; color: #ffffff;letter-spacing: 0.02rem;}
	  .xyg-nav .xyg-nav-content-right{float: right;}
	  .xyg-content{width:92%;margin:0rem 4%;position:absolute; top:3rem; padding:0.5rem 0px; border-radius:0.5rem; height:auto;background:#FFFFFF;}
	  .xyg-content .xyg-content-item{width:21%; height:auto; margin:0.5rem 2%; float:left;}
	  .xyg-content .xyg-content-item .xyg-content-item-pic{width:100%; height:auto;}
	  .xyg-content .xyg-content-item .xyg-content-item-pic img{width:2rem; height:2rem; margin:0.1rem auto;}
	  .xyg-content .xyg-content-item .xyg-content-item-title{width:100%; height:1rem; line-height:1rem; text-align:center; color:#9f9fa0; font-size:0.6rem;}
  </style>
  <div class="xyg-content">
  	<div class="xyg-content-item" onclick="changeHostReport('1',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_1.png"/>
		</div>
        <div class="xyg-content-item-title">
		  客户报备
		</div>
  	</div>
	  <div class="xyg-content-item" onclick="changeHostReport('9',this)">
		  <div class="xyg-content-item-pic">
			  <img src="${s.base}/mobile/wechat/images/my_icon_3.png"/>
		  </div>
		  <div class="xyg-content-item-title">
			  报备确认
		  </div>
	  </div>
    <div class="xyg-content-item" onclick="changeHostReport('2',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_2.png"/>
		</div>
        <div class="xyg-content-item-title">
		  到访确认
		</div>
  	</div>
    <div class="xyg-content-item" onclick="changeHostReport('34',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_4.png"/>
		</div>
        <div class="xyg-content-item-title">
			认筹/认购
		</div>
  	</div>
    <div class="xyg-content-item" onclick="changeHostReport('5',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_5.png"/>
		</div>
        <div class="xyg-content-item-title">
		  签约确认
		</div>
  	</div>
    <div class="xyg-content-item" onclick="changeHostReport('6',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_6.png"/>
		</div>
        <div class="xyg-content-item-title">
		  结单申请
		</div>
  	</div>
    <div class="xyg-content-item" onclick="changeHostReport('7',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_7.png"/>
		</div>
        <div class="xyg-content-item-title">
		  结单完成
		</div>
  	</div>
    <div class="xyg-content-item" onclick="changeHostReport('8',this)">
  		<div class="xyg-content-item-pic">
		  <img src="${s.base}/mobile/wechat/images/my_icon_8.png"/>
		</div>
        <div class="xyg-content-item-title">
		  无效客户
		</div>
  	</div>
    <div class="clearBoth"></div>
  </div>
  <!--内容结束-->
  <style type="text/css">

	  .xyg-title{width:92%; height:1.5rem; margin:7rem 4% 0px 4%; padding-left: 2%; line-height:1.5rem; font-size:0.8rem; color:#000000;}
	  .xyg-couser{width:92%; height:auto; margin:0.2rem 4%; }
	  .xyg-couser .xyg-zwyj{width: 100%; height: 6rem; line-height: 6rem; text-align: center;}
	  .xyg-couser .xyg-couser-item{width:96%; height:auto; padding:0.5rem 2%;background: #ffffff; border-radius: 0.2rem; margin-bottom: 0.4rem; }
	  .xyg-couser .xyg-couser-item .xyg-couser-item-line1{width:50%; height:1.2rem; line-height: 1.2rem; font-size: 14px; color: #d9d9d9;float: left;}
	  .xyg-couser .xyg-couser-item .xyg-couser-item-line2{width:100%; height:1.2rem; line-height: 1.2rem; font-size: 14px; color: #d9d9d9;float: left;}
	  .xyg-couser .xyg-couser-item .xyg-couser-item-name{color:#1b1b1b; letter-spacing: 0.01rem; }
  </style>
  <div class="xyg-title">我的客户</div>

  <div class="xyg-couser">


  </div>
	  <!--底部菜单开始-->
	  <div style="width:100%; height:2.5rem;"></div>
	  <div class="xyg-comp-bottom">
		  <div class="xyg-comp-bottom-item">
			  <a href="javascript:goFistPage('${memberId}')">
				  <img src="${s.base}/mobile/wechat/images/menu_icon_1.png"/>
				  <div class="xyg-comp-bottom-item-text">首页</div>
			  </a>
		  </div>
		  <div class="xyg-comp-bottom-item">
			  <a href="javascript:goKhPage('${memberId}')">
				  <img src="${s.base}/mobile/wechat/images/menu_icon_2_a.png"/>
				  <div class="xyg-comp-bottom-item-text  select-text">客户</div>
			  </a>
		  </div>
		  <div class="xyg-comp-bottom-item">
			  <a href="javascript:goMyPage('${memberId}')">
				  <img src="${s.base}/mobile/wechat/images/menu_icon_4.png"/>
				  <div class="xyg-comp-bottom-item-text">我的</div>
			  </a>
		  </div>
		  <div class="clearBoth"></div>
	  </div>

  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/base/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/swiper.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/component.js?12323434323232323232" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/wechat/fonts/iconfont.js"></script>
  <script src="${s.base}/mobile/wechat/js/window_port.js"></script>
  <script src="${s.base}/mobile/wechat/js/base.js"></script>

  <script type="text/javascript">
      var reportState='${reportState}';
      var memberId='${memberId}';
      $(document).ready(function(e) {
          initDate();
      });

      function initDate() {
          initContentNum();
      }

      function changeHostReport(state,obj) {
          reportState=state;
          pageNum = 1;
          $(".xyg-couser").html("");
          if(isDestroy){
              initContentNum();
          }else{
              sendPost();
          }
      }
      var pageNum = 0;
      var pageSize = 5;
      var loading = false;  //状态标记
      var isDestroy = false;  //状态标记
      /**
       * 初始化内容页面信息
       * @param cityId
       */
      function initContentNum() {
          isDestroy = false;
          $(document.body).infinite().on("infinite", function () {
              if (loading) return;
              loading = true;
              sendPost();
          });
          sendPost();
      }

      function sendPost() {
          pageNum++;
          $.fn.postMethodAll("/weChat/hostReport/page",{'pageNum':pageNum,'pageSize':pageSize,'reportState':reportState,'memberId':memberId},function (result) {
              if (result.data != null && result.data.length > 0) {
                  result.data.forEach(function (item,key,mapObj) {
                      var stateName="客户报备";
                      //报备状态：1、客户报备，2、到访确认，3、认筹确认，4、认购确认，5、签约确认，6、结单申请，7、结单完成，8、无效客户,9、报备确认
					  var moreStr='';
                      if(item.reportState=="2"){
                          stateName="到访确认";
                      }else if(item.reportState=="3"){
                          stateName="认筹确认";
                          moreStr='<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">总价：</span>'+item.allMoney+'元</div>'+
                              '<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">佣金：</span>'+item.feeMoney+'元（待生效）</div>';
                      }else if(item.reportState=="4"){
                          stateName="认购确认";
                          moreStr='<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">总价：</span>'+item.allMoney+'元</div>'+
                              '<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">佣金：</span>'+item.feeMoney+'元（待生效）</div>';
                      }else if(item.reportState=="5"){
                          stateName="签约确认";
                          moreStr='<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">总价：</span>'+item.allMoney+'元</div>'+
                              '<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">佣金：</span>'+item.feeMoney+'元（待申请）</div>';
                      }else if(item.reportState=="6"){
                          stateName="结单申请";
                          moreStr='<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">总价：</span>'+item.allMoney+'元</div>'+
                              '<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">佣金：</span>'+item.feeMoney+'元（待结算）</div>';
                      }else if(item.reportState=="7"){
                          stateName="结单完成";
                          moreStr='<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">总价：</span>'+item.allMoney+'元</div>'+
                              '<div class="xyg-couser-item-line1">'+
                              '<span class="xyg-couser-item-name">佣金：</span>'+item.feeMoney+'元（已发放）</div>';
                      }else if(item.reportState=="8"){
                          stateName="无效客户";
                      }else if(item.reportState=="9"){
                          stateName="报备确认";
                      }

                      var str='<div class="xyg-couser-item">'+
                          '<div class="xyg-couser-item-line1">'+
                          '<span class="xyg-couser-item-name">'+item.name+'</span>'+
                          '</div>'+
                          '<div class="xyg-couser-item-line1">'+
                          '<span class="xyg-couser-item-name">手机号：</span>'+item.phone+'</div>'+
                          '<div class="xyg-couser-item-line1">'+
                          '<span class="xyg-couser-item-name">状态：</span>'+stateName+'</div>'+
                          '<div class="xyg-couser-item-line1">'+
                          '<span class="xyg-couser-item-name">预约楼盘：</span>'+item.itemName+'</div>'+
                          '<div class="xyg-couser-item-line2">'+
                          '<span class="xyg-couser-item-name">提交时间：</span>'+item.createTimeStr+'</div>'+moreStr+'<div class="clearBoth"></div>'+
                          '</div>';
                      $(".xyg-couser").append(str);
                  });
                  loading = false;
                  if (!result.hasNextPage) {
                      $(document.body).destroyInfinite();
                      isDestroy=true;
                  }
              } else {
                  $(document.body).destroyInfinite();
                  isDestroy=true;
                  if(result.count==0){
                      $(".xyg-couser").html('<div class="xyg-zwyj">暂无客户</div>');
                  }
              }
          });
      }
  </script>
  
</html>

